﻿using MoneyManagerNET;
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using MoneyManagerNET.Presentation.ViewModel;

namespace Tests.Presentation.ViewModel
{
    
    
    /// <summary>
    ///This is a test class for UtilTest and is intended
    ///to contain all UtilTest Unit Tests
    ///</summary>
    [TestClass()]
    public class UtilTest
    {


        private TestContext testContextInstance;

        /// <summary>
        ///Gets or sets the test context which provides
        ///information about and functionality for the current test run.
        ///</summary>
        public TestContext TestContext
        {
            get
            {
                return testContextInstance;
            }
            set
            {
                testContextInstance = value;
            }
        }

        #region Additional test attributes
        // 
        //You can use the following additional attributes as you write your tests:
        //
        //Use ClassInitialize to run code before running the first test in the class
        //[ClassInitialize()]
        //public static void MyClassInitialize(TestContext testContext)
        //{
        //}
        //
        //Use ClassCleanup to run code after all tests in a class have run
        //[ClassCleanup()]
        //public static void MyClassCleanup()
        //{
        //}
        //
        //Use TestInitialize to run code before running each test
        //[TestInitialize()]
        //public void MyTestInitialize()
        //{
        //}
        //
        //Use TestCleanup to run code after each test has run
        //[TestCleanup()]
        //public void MyTestCleanup()
        //{
        //}
        //
        #endregion


        /// <summary>
        ///A test for Associate
        ///</summary>
        public void AssociateTestHelper<T>()
            where T : IViewModel
        {
            T viewModel = default(T); // TODO: Initialize to an appropriate value
            Type windowType = null; // TODO: Initialize to an appropriate value
            Util.Associate<T>(viewModel, windowType);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void AssociateTest()
        {
            Assert.Inconclusive("No appropriate type parameter is found to satisfies the type constraint(s) of T. " +
                    "Please call AssociateTestHelper<T>() with appropriate type parameters.");
        }

        /// <summary>
        ///A test for Associate
        ///</summary>
        public void AssociateTest1Helper<TViewModel, TView>()
            where TViewModel : IViewModel
        {
            Util.View2ViewModel<TViewModel, TView>();
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        [TestMethod()]
        public void AssociateTest1()
        {
            Assert.Inconclusive("No appropriate type parameter is found to satisfies the type constraint(s) of TVi" +
                    "ewModel. Please call AssociateTest1Helper<TViewModel, TView>() with appropriate " +
                    "type parameters.");
        }

        /// <summary>
        ///A test for GetView
        ///</summary>
        [TestMethod()]
        public void GetViewTest()
        {
            IViewModel viewModel = null; // TODO: Initialize to an appropriate value
            IScreen expected = null; // TODO: Initialize to an appropriate value
            IScreen actual;
            actual = Util.GetView(viewModel);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for Show
        ///</summary>
        [TestMethod()]
        public void ShowTest()
        {
            IViewModel vm = null; // TODO: Initialize to an appropriate value
            Util.Show(vm);
            Assert.Inconclusive("A method that does not return a value cannot be verified.");
        }

        /// <summary>
        ///A test for ShowDialog
        ///</summary>
        [TestMethod()]
        public void ShowDialogTest()
        {
            IViewModel vm = null; // TODO: Initialize to an appropriate value
            Nullable<bool> expected = new Nullable<bool>(); // TODO: Initialize to an appropriate value
            Nullable<bool> actual;
            actual = Util.ShowDialog(vm);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        /// <summary>
        ///A test for ViewModel
        ///</summary>
        public void ViewModelTestHelper<TViewModel>()
            where TViewModel : class
        {
            IView<TViewModel> view = null; // TODO: Initialize to an appropriate value
            TViewModel expected = null; // TODO: Initialize to an appropriate value
            TViewModel actual;
            actual = Util.ViewModel<TViewModel>(view);
            Assert.AreEqual(expected, actual);
            Assert.Inconclusive("Verify the correctness of this test method.");
        }

        [TestMethod()]
        public void ViewModelTest()
        {
            ViewModelTestHelper<GenericParameterHelper>();
        }
    }
}
